package cn.quicklydoit.entity;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.time.LocalDate;

/**
 * 公司  只获取第一个
 */
@Getter
@Setter
@NoArgsConstructor
@Entity
@Table(name = "x_company")
@Schema(description = "企业实体")
public class Company {

    @Id
    @Column
    @Schema(title = "unique",name = "id",required = true)
    private Long id;

    @Column
    @Schema(title = "编码",name = "code",required = true)
    private String code;
    @Column
    @Schema(title = "名称",name = "name",required = true)
    private String name;

    @Column
    @Schema(title = "简称",name = "shortName")
    private String shortName;

    @Column
    @Schema(title = "英文名",name = "enName")
    private String enName;

    @Column
    @Schema(title = "开始时间",name="startDate",required = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDate startDate;

    @Column
    @Schema(title = "结束时间",name="endDate")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDate endDate;


}
